Basic Pronunciation Editor
The Basic Pronunciation Editor provides very simple control over the pronunciations of words that are not pronounced correctly by Text-To-Speech engines. When using the Basic Editor, you simply substitute words that sound like the pronunciation you want, and TextAloud performs the substitutions automatically before sending text to the speech engine.
Accessing the Basic Pronunciation Editor
Changing the Pronunciation of Substrings
Pattern Matching With Masks and Regular Expressions
Accessing the Basic Pronunciation Editor
From the menu, select Options -> Pronunciation Editor
The following fields are available in the Basic Pronunciation Editor
Field Name | Description |
---|---|
Word | Enter the word you wish to enter a new pronunciation for. |
Pronunciation | Enter a word or phrase that sounds like the pronunciation you want. |
Case Sensitive | Indicate whether or not this substitution is case sensitive. |
Test Voice | Choose a voice from the dropdown list that will be used when testing the new pronunciation. |
To enter a new entry:
To modify the pronunciation for an existing entry:
To delete an existing entry:
Changing the Pronunciation of Substrings
By default, entries in the Basic Pronunciation Editor are applied only when text in the "Word" field actually occurs on a word boundary. Substitutions are not performed on text that appears as a substring of another word.
For example, entering an alternative pronunciation for the word "day" changes the pronunciation of "day" everywhere it appears as a word, but not in words like "today", "yesterday", etc.
To change the substitution of words that appear as substrings, use the & character. The placement of the & determines whether leading characters, trailing characters, or both should allow substitutions.
In the table below, a "Yes" in the column indicates that a Basic Pronunciation Editor substitution will be performed for the word.
Word Field of Pronunciation Editor | ||||
---|---|---|---|---|
Word In Text | board | &board | board& | &board& |
board | Yes | Yes | Yes | Yes |
snowboard | Yes | Yes | ||
boarding | Yes | Yes | ||
snowboarding | Yes |
Pattern Matching With Masks and Regular Expressions
Masks and Regular Expressions allow you to perform more complex filtering and pronunciation changes from the Basic Pronunciation Editor. Instead of specifying pronunciations for individual words or substrings, you can specify patterns to search for and build pronunciations based on subexpressions in the matching strings.
If you're not familiar with the term, Regular Expressions are a pattern matching language used for searching and parsing text. TextAloud help will not get into the detailed syntax of using Regular Expressions, so if you've never seen them before you will need to look at some reference material. There are plenty of references available on the web, you can get started by clicking here.
Although not as powerful as Regular Expressions, Masks provide similar capability and are easier to learn and use.
A Mask or Regular Expression is added to the Basic Pronunciation Editor by placing one of the following into the Word field:
{{re=.... regular expression ...}}
{{mask=.... mask ...}}
A string in the Word field beginning with {{re= or {{mask= indicates the beginning of a regular expression or mask. The trailing }} characters are required to terminate the string.
The following characters may be used to construct a Mask:
Mask Character
Description
#
Matches any digit (0 thru 9).
$
Matches any alpha character (a thru z and A thru Z).
@
Matches any alpha-numeric character (a thru z, A thru Z, and 0 thru 9).
?
Matches any character (wildcard).
_ (underscore)
Matches any word boundary character (spaces and punctuation).
In the Pronunciation field, supply the text that should be substituted for any text that matches the Mask or Regular Expression. Use sets of parentheses in the Mask / Regular Expression to indicate subexpressions that should be included in the Pronunciation field. $1 in the pronunciation field references the first parentheses set, $2 the second set, and so on. This allows you to change the pronunciations of text patterns, where the substituted text contains pieces of the strings that match the patterns.
The following examples will illustrate how to use a Mask or Regular Expressions to change the pronunciation of year numbers. The sample problem is to ensure that year numbers (like 1987) are pronounced as "nineteen eighty seven" and not "one thousand nine hundred and eighty seven".
Example 1 - Year Number Pronunciation Using a Mask
To solve this problem using a mask, enter the following text into the Word and Pronunciation fields:
Word: {{mask=_19(##)(_)}}
Pronunciation: <s>nineteen $1$2
The pattern specified by the mask is a leading word separator, followed by the string "19", two digits and another word separator. Whenever this pattern is detected in the text, the text in the Pronunciation field will replace it. The <s> in the pronunciation indicates to insert a space. This is necessary because the first character matched by the mask is a word separator, so a leading space should be included in the substitution. Following this space, the string "nineteen " is added. The $1 and $2 strings in the Pronunciation reference parentheses sets in the mask: $1 is replaced by the last two digits of the year, and $2 is replaced with any trailing punctuation.
Example 2 - Year Number Pronunciation Using a Regular Expression
To solve the same problem using a Regular Expression, enter the following text into the Word and Pronunciation fields:
Word: {{re=\b19(\d\d)(\b)}}
Pronunciation: <s>nineteen $1$2
The use of a regular expression is very similar to a mask in this case. The "\b" strings in the Regular Expression match on word separators, and the "\d" strings match on the digits 0 thru 9.
Tips
Notes
Related Topics